# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Chris Severance <aur.severach@spamgourmet.com>
# Contributor: Neal Buchanan <neal.buchanan@gmx.com>

pkgname=libldm
pkgver=0.2.5
pkgrel=2
pkgdesc='A tool and library for managing Microsoft Windows Dynamic Disks'
arch=(loong64 x86_64)
url=https://github.com/mdbooth/libldm
license=(
  GPL3
  LGPL3
)
depends=(
  device-mapper
  glib2
  json-glib
  libreadline.so
  libuuid.so
  zlib
)
makedepends=(
  git
  systemd
  gtk-doc
)
provides=(
  ldmtool
  libldm-1.0.so
)
conflicts=(ldmtool)
_tag=aa60557dc59b7aeeda5aaf694c71b7649340ab2f
source=(
  git+https://github.com/mdbooth/libldm.git#tag=${_tag}
  ldmtool.service
)
b2sums=('SKIP'
        'fa03762f3642959b8abd50e62f79cc23e0dfca49c7c7d661c38d49fd5282d5bd95ccf5b66562a7b005657312b4f4f72e92c4e75365f007ca09e8199b7ba9802a')

pkgver() {
  cd libldm

  git describe --tags | sed 's/^libldm-//; s/-/.r/; s/-g/./'
}

prepare() {
  cd libldm
  autoreconf -fiv
}

build() {
  cd libldm
  ./configure \
    --prefix=/usr
  make
}

package() {
  make DESTDIR="${pkgdir}" -C libldm install
  install -Dm 644 ldmtool.service -t "${pkgdir}"/usr/lib/systemd/system/
}

# vim: ts=2 sw=2 et:
